<template>
  <div class="home">
    <div class="hero">
      <h1>Vue Toolkit</h1>
      <p class="hero-description">
        一个基于 Vue 3 + TypeScript 的现代化工具库，提供可复用的组件和实用工具函数
      </p>
      <div class="hero-actions">
        <router-link to="/components" class="btn btn-primary">
          查看组件
        </router-link>
        <router-link to="/utils" class="btn btn-outline">
          查看工具
        </router-link>
      </div>
    </div>

    <div class="features">
      <div class="feature-card">
        <div class="feature-icon">🧩</div>
        <h3>丰富组件</h3>
        <p>提供 Button、Modal 等常用 UI 组件，支持多种样式和配置</p>
      </div>
      
      <div class="feature-card">
        <div class="feature-icon">🛠️</div>
        <h3>实用工具</h3>
        <p>包含格式化、验证等常用工具函数，提升开发效率</p>
      </div>
      
      <div class="feature-card">
        <div class="feature-icon">📝</div>
        <h3>TypeScript</h3>
        <p>完整的 TypeScript 支持，提供优秀的开发体验</p>
      </div>
      
      <div class="feature-card">
        <div class="feature-icon">🚀</div>
        <h3>现代化</h3>
        <p>基于 Vue 3 + Vite 构建，支持按需导入和树摇优化</p>
      </div>
    </div>

    <div class="quick-start">
      <h2>快速开始</h2>
      <div class="code-block">
        <pre><code># 安装
npm install vue-toolkit

# 使用
import { createApp } from 'vue'
import VueToolkit from 'vue-toolkit'
import 'vue-toolkit/dist/style.css'

const app = createApp(App)
app.use(VueToolkit)
app.mount('#app')</code></pre>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 首页组件逻辑
</script>

<style scoped>
.home {
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 4rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background: #fff;
  color: #667eea;
}

.btn-primary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn-outline:hover {
  background: #fff;
  color: #667eea;
  transform: translateY(-2px);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.feature-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.feature-card p {
  color: #718096;
  line-height: 1.6;
}

.quick-start {
  background: #f7fafc;
  padding: 3rem;
  border-radius: 12px;
  text-align: center;
}

.quick-start h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: #2d3748;
}

.code-block {
  background: #2d3748;
  border-radius: 8px;
  padding: 2rem;
  text-align: left;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  color: #e2e8f0;
  font-family: 'Courier New', Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 200px;
  }
}
</style>